Repository navigation
Retry main watcher queueing safely - #8952
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c34b2cb5bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -n "$INPUT_DEDUPE_KEY" ]; then | ||
| retryable=true |
There was a problem hiding this comment.
Exclude issue-creation requests from automatic retries
When a caller supplies dedupe_key without issue_number and leaves issue at its default true, a lost response after a successful POST causes the retry to create another GitHub issue. In pm-stack/dispatch/src/server.ts, handleTasks creates the issue before deduplicating the queue task (lines 437–438), then returns the newly created issue number even when enqueue returns the existing task (lines 557–562). Consequently, the action reports an issue that the task does not track and leaves duplicate labeled issues behind. Restrict retries to existing-issue attachments or issue=false until issue creation itself is idempotent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 991fc8a (task 17197, lane any-c).
You are right: a dedupe_key alone made requests retryable, and handleTasks creates the tracking issue before deduplicating the task, so a lost response + retry would duplicate the issue.
post-task.sh: when retries are requested, the payload must now attach to an existing issue (issue_number) or create no issue (issue != true); an issue-creation payload is refused before any request is made.action.yml:retryableis computed with the same rule (dedupe key AND (issue_number set OR issue != true)).- Contract tests: new cases cover the issue-creation refusal (no request made) and the existing-issue attach retry (502 then success), plus a grep guard on the action.yml condition.
bash .github/scripts/pm-dispatch-queue-post.test.shpasses.
The branch was also rebased onto current main; the previously failing ci-policy agreement contract test passes on the rebased branch (it failed on the stale Nov 12 base and passes on clean main).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Agent note — task 17197 picked up (lane any-c)
|
Codex P2 on PR #8952: a dedupe_key alone made issue-creation requests retryable, but handleTasks creates the tracking issue before deduplicating the task, so a lost response followed by a retry would create a duplicate issue. post-task.sh now refuses retries when the payload would create an issue (issue=true without issue_number), and the composite action computes retryable with the same rule. Contract tests cover both the refusal and the existing-issue attach case.
c34b2cb to
991fc8a
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Agent note — task 17197 done: fixed_merged (lane any-c)
|
Summary
The watcher retries a queue POST only when its caller supplies a stable dedupe key:
Create-task calls without a stable key remain single-attempt, avoiding duplicate task creation. Adds a focused contract test for retries, exhaustion, non-retryable responses, and key requirements.
Fixes #8950
Evidence
bash .github/scripts/pm-dispatch-queue-post.test.shpasses, including transient retries, no-key safety, and non-retryable responses.Merge Danger
Door: Two-way.
Blast Radius: Low — retries are enabled only for calls with an explicit idempotency key; other composite-action callers retain one-attempt behavior.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.